import request from './request'

// 接口
//获取验证码
export const validCode = () => request.get('/validCode');

// 登录
export const login = (data) => request.post('/login', data);

// 注册
export const register = (data) => request.put('/register', data);

//上传收货地址
export const addr = data => request.put('/addr', data);

//获取收货地址
export const getAddr = () => request.get('/addr');

//删除
export const delAddr = data => request.delete('/addr',{params:data});

//修改
export const modification = data => request.post('/addr', data);

//设为默认地址
export const defaultAddr = data => request.post('/defaultAddr', data);

//获取商品
export const getprod = (data) => request.get('/prod', {params: data});

//获取轮播图
export const banner = data => request.get('/banner', data);

// 获取秒杀商品
export const getSeckill = data => request.get('/secKill', {params: data});

//添加商品到购物车
export const addCart = data => request.put('/cart', data);

//获取购物车的商品
export const getCart = () => request.get('/cart');

//推荐购物车的商品
export const getRecommend = () => request.get('./recommend');

//更新购物车的商品数量
export const updateCart = data => request.post('/cart', data);

//删除购物车的商品
export const delcart  = data => request.post('/delcart ', data);
